<!DOCTYPE html>
<html ng-app="test">
<head>
  <meta charset="UTF-8">
  <title></title>
  <link rel="stylesheet" href="../node_modules/angular-ui-tree/dist/angular-ui-tree.css">
</head>
<body ng-controller="myCtrl">
<div ui-tree data-drag-enabled="false">
  <ol ui-tree-nodes="" ng-model="list">
    <li ng-repeat="item in list" ui-tree-node>
      <div>
        {{item.title}}
        <button ng-click="toggle(this)">haha</button>
      </div>
      <ol ui-tree-nodes="" ng-model="item.items">
        <li ng-repeat="subItem in item.items" ui-tree-node>
          <div>
            {{subItem.title}}
          </div>
        </li>
      </ol>
    </li>
  </ol>
</div>
  <script src="../node_modules/angular/angular.js"></script>
  <script src="../node_modules/angular-ui-tree/dist/angular-ui-tree.js"></script>
  <script>
    angular.module('test', ['ui.tree'])
        .controller('myCtrl', function ($scope) {
          $scope.list = [
              { title: 1,
                items: [{title: 1.1}, {title: 1.1}]},
              { title: 1,
                items: [{title: 1.1}]},
              { title: 1,
                items: [{title: 1.1}]},
              { title: 1,
                items: [{title: 1.1}]}
          ]
          $scope.toggle = function (scope) {
            scope.toggle();
          };
        })
  </script>

</body>
</html>